#include "display/game/ShotGraphic.hpp"

#include "util/Text.h"

ShotGraphic::ShotGraphic(Shot* p_shot) : Displayable(0), m_shot(p_shot)
{
    m_image = new sf::Image;
    if (!m_image->LoadFromFile("sprites/Mariofiresprites.png"))
        Debug::printTrace(Debug::critical, "display/game/CharacterGraphique.constructor", "Unable to load the picture");

    m_sprite = new sf::Sprite();

    m_sprite->SetImage(*m_image);
    //m_sprite->SetSubRect(sf::IntRect(32*9,32*0,32*10-2,32*1-2));
}

ShotGraphic::~ShotGraphic()
{
    delete m_sprite;
    delete m_image;
}
/**
 * draw the shot
 */
void ShotGraphic::draw(sf::RenderWindow* window)
{
	//Debug::printTrace(Debug::critical, "display/game/CharacterGraphique.draw",  Text::float2string(m_character->Getposition().x));
	//Debug::printTrace(Debug::critical, "display/game/CharacterGraphique.draw",  Text::float2string(m_character->Getposition().y));

    m_sprite->SetPosition(m_shot->Getposition());

    window->Draw(*m_sprite);

}
/**
 * Not implemented
 */
void ShotGraphic::DoEvent(sf::Event e)
{
	//nothing
}

/**
 * Not implemented
 */
void ShotGraphic::DoRealTimeEvent(const sf::Input& p_event)
{
	//nothing
}
